package com.zjitc.mapper;

import com.zjitc.pojo.Product;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * Create by IntelliJ IDEA
 *
 * @author: jsonor
 * @date-Time: 2018/3/12 16:27
 * @description:
 */
public interface ProductMapper {

  @Insert("insert into product(product_name,product_count"
      + ",product_price,product_type)'"
      + "value('a',4,50.2,'电器'),"
      + "value('b',15,66.2,'鞋子')")
  Product insert(Product product);

  @Select("select *from product where product_id=#{product_id}")
  Product findById(int id);

  @Delete("delete from product where product_id=3")
  Product delete(int id);

  @Update("update product set product_count=100 where product_id=1")
  Product update(int id);
}
